package com.joe.xl.devcommon1.config;

import org.redisson.Redisson;
import org.redisson.api.RedissonClient;
import org.redisson.config.Config;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

/**
 * redisson 配置bean注入到容器中
 *
 * @Author joexl <joe_xuli@163.com>
 * @Since 1.0
 * @Date 2020/10/23
 */
@Component
public class RedissonConfig {

    @Bean
    public RedissonClient redissonClient(){
        Config config = new Config();
        config.useSingleServer().setAddress("redis://192.168.78.128:6379").setPassword("joe123456");

        return Redisson.create(config);
    }
}
